#include <iostream>
#include <vector>
#include <fstream>
using namespace std;

vector<double> series(double a, double b, int n)
{
    vector<double> result(n);
    double interval = (b - a) / (n - 1);
    for (int i = 0; i < n; i++)
        result[i] = a + i * interval;
    return result;
}

double f(double x)
{
    double result = 0;
    result += x * x * x * x * x * x * x * x;
    result -= 8 * x * x * x * x * x * x * x;
    result += 28 * x * x * x * x * x * x;
    result -= 56 * x * x * x * x * x;
    result += 70 * x * x * x * x;
    result -= 56 * x * x * x;
    result += 28 * x * x;
    result -= 8 * x;
    result += 1;
    return result;
}

double g(double x)
{
    double result = 0;
    result = x - 8;
    result = x * result + 28;
    result = x * result - 56;
    result = x * result + 70;
    result = x * result - 56;
    result = x * result + 28;
    result = x * result - 8;
    result = x * result + 1;
    return result;
}

double h(double x)
{
    double dx = x - 1;
    double result = 1;
    for (int i = 0; i < 8; i++)
        result *= dx;
    return result;
}

void print(const vector<double> &vec)
{
    for (int i = 0; i < vec.size(); i++)
        cout << vec[i] << " ";
    cout << endl;
}

int main()
{
    int N = 10;
    vector<double> x = series(0.99, 1.01, N);
    vector<double> yf(N);
    vector<double> yg(N);
    vector<double> yh(N);
    for (int i = 0; i < N; i++)
    {
        yf[i] = f(x[i]);
        yg[i] = g(x[i]);
        yh[i] = h(x[i]);
        cout << yf[i] << " " << yg[i] << " " << yh[i] << endl;
    }
    // ofstream ofs;
    // ofs.open("a.txt",ios::out);
    // for (int i=0;i<N;i++) ofs << x[i] << " ";
    // ofs <<endl;
    // for (int i=0;i<N;i++) ofs << yf[i] << " ";
    // ofs <<endl;
    // for (int i=0;i<N;i++) ofs << yg[i] << " ";
    // ofs <<endl;
    // for (int i=0;i<N;i++) ofs << yh[i] << " ";
    // ofs <<endl;
    // ofs.close();
}